import Vue from "vue";
import VueRouter from "vue-router";
import Login from '../views/login'

import Index from "../views/index.vue";
import IndexHomePage from "../components/indexViews/indexHomePage.vue";
import BranchWork from "../components/indexViews/branchWork.vue";

Vue.use(VueRouter);

const routes = [
  { path: "/", meta: { title: '' }, redirect: "/login" },
  { path: "/login", meta: { title: '登录页面' }, component: Login },//登陆页面
  { path: "/index", meta: { title: '首页' }, component: Index,
    //重定向
    redirect: '/index/indexHomePage', 
    //子路由
    children:[
     { path: '/index/indexHomePage', component: IndexHomePage },
     { path: '/index/branchWork', component: BranchWork }
    ]
  },
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;

